﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using OpenGado.Business;
using OpenGado.DATA;
using OpenGado.DATA.Entities;

namespace OpenGado.Win
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
        //   IList<Categories> cats = new List<Categories>();
        //    cats = CategoryDataControl.Instance.GetAllCategories();
                
        //    foreach (Categories c in cats)
        //    {
        //        comboBox1.Items.Add(c.CategoryName);
        //    }

            IList<Project> pjs = new List<Project>();

            pjs = ProjectDataControl.Instance.GetAllProjects();

            comboBox1.DataSource = pjs;
            comboBox1.DisplayMember = "Name";

           

        }

        private void button1_Click(object sender, EventArgs e)
        {

            MessageBox.Show(((Project)comboBox1.SelectedItem).Name);
        

        }

        private void comboBox1_TextUpdate(object sender, EventArgs e)
        {
            MessageBox.Show((((Project) comboBox1.SelectedItem).Name = comboBox1.Text));
        }

       
       
    }
}
